﻿

    //学院
    $(function () {
        $.ajax({
            url: "/SysUserInfo/CollegeList",
            type: "get",
            dataType: "json",
            success: function (obj) {
                $("#College").empty();
                for (var i = 0; i < obj.length; i++) {
                    $("#College").append("<option value='" + obj[i].ID + "'>" + obj[i].College_Name + "</option>");
                }
                changeTie()
            }
        });
    })
//系
function changeTie() {
    $("#Tie").empty();
    var ParentID = $("#College").val();
    $.ajax({
        url: "/SysUserInfo/TieList?ParentID=" + ParentID,
        type: "get",
        //data: { ParentID: ParentID },
        dataType: "json",
        success: function (obj) {
            for (var i = 0; i < obj.length; i++) {
                $("#Tie").append("<option value='" + obj[i].ID + "'>" + obj[i].Tie_Name + "</option>");
            }
            changephasetable();

        }
    })
}
//阶段
function changephasetable() {
    $("#phasetable").empty();
    var ParentID = $("#Tie").val();
    $.ajax({
        url: "/SysUserInfo/PhaseTableList?ParentID=" + ParentID,
        type: "get", 
        dataType: "json",
        success: function (obj) {
            for (var i = 0; i < obj.length; i++) {
                $("#phasetable").append("<option value='" + obj[i].ID + "'>" + obj[i].Phase_Name + "</option>");
            }
           changeclass()
        }
        
    })
}








///班级
function changeclass() {

    //$("#classtable").text = "";// 清空数据
    var ParentID = $("#phasetable").val();
    $.ajax({
        url: "/SysUserInfo/ClassTableList?ParentID=" + ParentID,
        type: "get",
        dataType: "json",
        success: function (obj) {
            for (var i = 0; i < obj.length; i++) {
                $("#classtable").append(" <input id=\"Checkbox1\" value=\"" + obj[i].ID + "\" type=\"checkbox\" /><span>" + obj[i].Class_Name + " </span>")
            }
        }
    })
}